/*
 * Copyright (c) 2022-2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "test_player_old.h"
#include "gtest/gtest.h"

using namespace OHOS::Media;

namespace OHOS::Media::Test {
class StTestPlayerExit : public ::testing::Test {
    virtual void SetUp() override
    {
    }
    virtual void TearDown() override
    {
    }
};

TEST_F(StTestPlayerExit, test_play_local_source_two_times)
{
    ASSERT_TRUE(StartPlayer(RESOURCE_DIR "/MP3/MP3_LONG_48000_32.mp3"));
    ASSERT_TRUE(StartPlayer(RESOURCE_DIR "/MP3/MP3_LONG_48000_32.mp3"));
}

// Run these http tests, should run hfs.exe and add resource-src folder to it.
TEST_F(StTestPlayerExit, test_play_http_non_live_source_two_times)
{
    ASSERT_TRUE(StartPlayer("http://localhost/resource-src/media/MP3/MP3_LONG_48000_32.mp3"));
    ASSERT_TRUE(StartPlayer("http://localhost/resource-src/media/MP3/MP3_LONG_48000_32.mp3"));
}
}
